/**
 * 
 */
package com.bbshop.bean.product;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

/**
 * @author Administrator
 * 
 */
@Entity
public class Brand implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -5591277489341183742L;
	private String code;
	private String name;
	private String logopath;
	private boolean visiable = true;

	public Brand() {
	}

	public Brand(String name, String logopath) {
		super();
		this.name = name;
		this.logopath = logopath;
	}

	@Id
	@Column(length = 36)
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	@Column(length = 40, nullable = false)
	public void setName(String name) {
		this.name = name;
	}

	public String getLogopath() {
		return logopath;
	}

	@Column(length = 80)
	public void setLogopath(String logopath) {
		this.logopath = logopath;
	}

	@Column(nullable = false)
	public boolean isVisiable() {
		return visiable;
	}

	public void setVisiable(boolean visiable) {
		this.visiable = visiable;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((code == null) ? 0 : code.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Brand other = (Brand) obj;
		if (code == null) {
			if (other.code != null)
				return false;
		} else if (!code.equals(other.code))
			return false;
		return true;
	}

}
